<template>
  <div class="charts" ref="charts"></div>

</template>

<script>
import echarts from "echarts";
export default {
  // 定义属性
  data() {
    return {};
  },
  mounted() {
    this.getProgress();
  },
  methods: {
    getProgress() {
      let ProgressCharts = echarts.init(this.$refs.charts);
      ProgressCharts.setOption({
        xAxis: {
          show: false,
          min: 0,
          max: 100,
        },
        yAxis: {
          show: false,
          type: "category",
        },
        series: [
          {
            type: "bar",
            data: [78],
            color: "cyan",
            barWidth: 10,
            color: "yellowgreen",
            showBackground: true,
            backgroundStyle: {
              color: "#eee",
            },
            label: {
              show: true,
              formatter: "|",
              position: "right",
            },
          },
        ],
        //布局调试
        grid: {
          left: 0,
          top: 0,
          right: 0,
          bottom: 0,
        },
      });
    },
  },
};
</script>

<style scoped>
.charts {
  width: 100%;
  height: 100%;
}
</style>